//
// CTargetAnimCtrl.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;

public class CTargetAnimCtrl extends IAnimCtrl {
  private long swigCPtr;

  public CTargetAnimCtrl(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CTargetAnimCtrl_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CTargetAnimCtrl obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CTargetAnimCtrl(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public void setMode(CTargetAnimCtrl.TMode value) {
    nel3dJNI.CTargetAnimCtrl_Mode_set(swigCPtr, this, value.swigValue());
  }

  public CTargetAnimCtrl.TMode getMode() {
    return CTargetAnimCtrl.TMode.swigToEnum(nel3dJNI.CTargetAnimCtrl_Mode_get(swigCPtr, this));
  }

  public void setWorldTarget(CVector value) {
    nel3dJNI.CTargetAnimCtrl_WorldTarget_set(swigCPtr, this, CVector.getCPtr(value), value);
  }

  public CVector getWorldTarget() {
    long cPtr = nel3dJNI.CTargetAnimCtrl_WorldTarget_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CVector(cPtr, false);
  }

  public void setEyePos(CVector value) {
    nel3dJNI.CTargetAnimCtrl_EyePos_set(swigCPtr, this, CVector.getCPtr(value), value);
  }

  public CVector getEyePos() {
    long cPtr = nel3dJNI.CTargetAnimCtrl_EyePos_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CVector(cPtr, false);
  }

  public void setCurrentWorldDirection(SWIGTYPE_p_NLMISC__CQuat value) {
    nel3dJNI.CTargetAnimCtrl_CurrentWorldDirection_set(swigCPtr, this, SWIGTYPE_p_NLMISC__CQuat.getCPtr(value));
  }

  public SWIGTYPE_p_NLMISC__CQuat getCurrentWorldDirection() {
    long cPtr = nel3dJNI.CTargetAnimCtrl_CurrentWorldDirection_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NLMISC__CQuat(cPtr, false);
  }

  public void setEnabled(boolean value) {
    nel3dJNI.CTargetAnimCtrl_Enabled_set(swigCPtr, this, value);
  }

  public boolean getEnabled() {
    return nel3dJNI.CTargetAnimCtrl_Enabled_get(swigCPtr, this);
  }

  public void setDefaultWorldDirection(SWIGTYPE_p_NLMISC__CQuat value) {
    nel3dJNI.CTargetAnimCtrl_DefaultWorldDirection_set(swigCPtr, this, SWIGTYPE_p_NLMISC__CQuat.getCPtr(value));
  }

  public SWIGTYPE_p_NLMISC__CQuat getDefaultWorldDirection() {
    long cPtr = nel3dJNI.CTargetAnimCtrl_DefaultWorldDirection_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NLMISC__CQuat(cPtr, false);
  }

  public void setMaxAngle(float value) {
    nel3dJNI.CTargetAnimCtrl_MaxAngle_set(swigCPtr, this, value);
  }

  public float getMaxAngle() {
    return nel3dJNI.CTargetAnimCtrl_MaxAngle_get(swigCPtr, this);
  }

  public void setMaxAngularVelocity(float value) {
    nel3dJNI.CTargetAnimCtrl_MaxAngularVelocity_set(swigCPtr, this, value);
  }

  public float getMaxAngularVelocity() {
    return nel3dJNI.CTargetAnimCtrl_MaxAngularVelocity_get(swigCPtr, this);
  }

  public CTargetAnimCtrl() {
    this(nel3dJNI.new_CTargetAnimCtrl(), true);
  }

  public void execute(CSkeletonModel model, CBone bone) {
    nel3dJNI.CTargetAnimCtrl_execute(swigCPtr, this, CSkeletonModel.getCPtr(model), model, CBone.getCPtr(bone), bone);
  }

  public final static class TMode {
    public final static TMode TargetMode = new TMode("TargetMode", nel3dJNI.CTargetAnimCtrl_TargetMode_get());
    public final static TMode DirectionMode = new TMode("DirectionMode");
    public final static TMode NumMode = new TMode("NumMode");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TMode swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TMode.class + " with value " + swigValue);
    }

    private TMode(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TMode(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TMode(String swigName, TMode swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TMode[] swigValues = { TargetMode, DirectionMode, NumMode };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
